﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="AskAQuestion.aspx.vb" Inherits="TechJunkieProj.AskAQuestion" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
    </p>
    <link href='http://fonts.googleapis.com/css?family=Kaushan+Script|UnifrakturMaguntia' rel='stylesheet' type='text/css'>&nbsp;
       
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<h1 class= "PageTitle">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<u>Ask A Question</u></h1>
    <br />
    <br />
    <br /><br /><br />
    <br /><br />
    <p>
        Have a question.....Just Ask!!!!</p>
    <asp:Panel ID="Panel1" runat="server" 
        BorderStyle="Solid" Height="255px" 
        Width="684px" BackColor="Silver"><br />
        Enter Your question:<br /><br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp<asp:TextBox ID="Tb_Question" runat="server" Height="138px" 
            TextMode="MultiLine" Width="494px">Type the question</asp:TextBox>
    
    <br />
    <br />
       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<asp:Button ID="Btn_ask" runat="server" Text="Submit Question" />
    <br />
    <br />
    </asp:Panel>
    <p>
        </p>
    <p>
        Look for an existing questions....</p>
    <asp:Panel ID="Panel2" runat="server" BorderStyle="Solid" BorderColor="#CCCCCC">
    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" 
            DataKeyNames="ID">
        <AlternatingItemTemplate>
            <span style="">
            &nbsp;<asp:HyperLink ID = "HyperLink1" NavigateUrl='<%# Eval("ID", "ViewQuestionDetails.aspx?ID={0}") %>'  runat="server" ><asp:Label ID="QuestionLabel" runat="server" Text='<%# Eval("Question") %>' />
</asp:HyperLink><br />Author: <asp:Label ID="AuthorLabel" runat="server" Text='<%# Eval("Author") %>' />
            <br />
            Date Updated: <asp:Label ID="DateUpdatedLabel" runat="server" 
                Text='<%# Eval("DateUpdated") %>' />
            <br />
            <br />
            <hr />
            </span>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <span style="">Question: <asp:TextBox ID="QuestionTextBox" runat="server" 
                Text='<%# Bind("Question") %>' />
            <br />
            Author: <asp:TextBox ID="AuthorTextBox" runat="server" Text='<%# Bind("Author") %>' />
            <br />
            DateUpdated: <asp:TextBox ID="DateUpdatedTextBox" runat="server" 
                Text='<%# Bind("DateUpdated") %>' />
            <br />
            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                Text="Update" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Cancel" />
            <br /><br /></span>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <span>No data was returned.</span></EmptyDataTemplate><InsertItemTemplate>
            <span style="">Question: <asp:TextBox ID="QuestionTextBox" runat="server" 
                Text='<%# Bind("Question") %>' />
            <br />Author: <asp:TextBox ID="AuthorTextBox" runat="server" Text='<%# Bind("Author") %>' />
            <br />DateUpdated: <asp:TextBox ID="DateUpdatedTextBox" runat="server" 
                Text='<%# Bind("DateUpdated") %>' />
            <br />
            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                Text="Insert" />
            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                Text="Clear" />
            <br /><br /></span>
        </InsertItemTemplate>
        <ItemTemplate>
            <span style="">
            <asp:HyperLink ID = "HyperLink1" NavigateUrl='<%# Eval("ID", "ViewQuestionDetails.aspx?ID={0}") %>'  runat="server" ><asp:Label ID="QuestionLabel" runat="server" Text='<%# Eval("Question") %>' />
</asp:HyperLink><br />Author: <asp:Label ID="AuthorLabel" runat="server" Text='<%# Eval("Author") %>' />
            <br />
            Date Updated: <asp:Label ID="DateUpdatedLabel" runat="server" 
                Text='<%# Eval("DateUpdated") %>' />
            <br />
            <br />
            <hr />
            </span>
        </ItemTemplate>

        <LayoutTemplate>
            <ul ID="itemPlaceholderContainer" runat="server" style="">
                <li runat="server" id="itemPlaceholder" />
            </ul>
            <div style="">
                <asp:DataPager ID="DataPager1" runat="server">
                    <Fields>
                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                            ShowLastPageButton="True" />
                    </Fields>
                </asp:DataPager>
            </div>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <span style="">Question: <asp:Label ID="QuestionLabel" runat="server" Text='<%# Eval("Question") %>' />
            <br />
            Author: <asp:Label ID="AuthorLabel" runat="server" Text='<%# Eval("Author") %>' />
            <br />
            DateUpdated: <asp:Label ID="DateUpdatedLabel" runat="server" 
                Text='<%# Eval("DateUpdated") %>' />
            <br />
<br /></span>
        </SelectedItemTemplate>

    </asp:ListView>
    </asp:Panel>
    
    <p>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionStringList %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionStringList.ProviderName %>" 
            
            
            SelectCommand="SELECT [Question], [Author], [DateUpdated], [ID] FROM [Question] ORDER BY [DateUpdated] DESC"></asp:SqlDataSource>
    </p>
    <p>
        &nbsp;</p><p>
        &nbsp;</p></asp:Content>